home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / alle / rcom / demo / demo.c next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  1.5 KB  |  52 lines

  1.  
  2. /*
  3. *
  4. *  Demonstration for Handling of compiled resources
  5. *
  6. *  Link this file in two ways:
  7. *
  8. *  - without DEMRSC.O and RSRC.O: the resource will be loaded from disk
  9. *  - with DEMRSC.O and RSRC.O: the resource is included in the program file
  10. *
  11. *  You won't have to change anything in the source code!
  12. *
  13. */
  14.  
  15.  
  16. #include <aes.h>
  17. #include "demorsc.h"
  18.  
  19.  
  20.  
  21. int main()
  22. {
  23.  
  24.    int      x,y,w,h;                /* pos and size of demo form */
  25.    OBJECT   *pmenu,                 /* ^ to menu bar tree */
  26.             *pform;                 /* ^ to form tree */
  27.  
  28.  
  29.    appl_init();                     /* init AES */
  30.  
  31.    rsrc_load("demorsc.rsc");        /* load the resource */
  32.    rsrc_gaddr(R_TREE,MENU,&pmenu);  /* get ^ to menu bar */
  33.    rsrc_gaddr(R_TREE,FORM,&pform);  /* and ^ to form */
  34.    menu_bar(pmenu,1);               /* show menu bar */
  35.    form_center(pform,&x,&y,&w,&h);  /* center form */
  36.  
  37.                                     /* lock redraw area */
  38.    form_dial(FMD_START,0,0,0,0,x,y,w,h);
  39.                                     /* draw form */
  40.    objc_draw(pform,ROOT,MAX_DEPTH,x,y,w,h);
  41.    evnt_keybd();                    /* wait for any key */
  42.                                     /* force redraw of form background */
  43.    form_dial(FMD_FINISH,0,0,0,0,x,y,w,h);
  44.  
  45.    menu_bar(pmenu,0);               /* hide menu bar */
  46.    rsrc_free();                     /* remove resource */
  47.    appl_exit();                     /* exit AES */
  48.  
  49.    return 0;
  50. }
  51.  
  52.